<?php
error_reporting(E_ERROR);
ini_set('display_errors', 1);
############################### CONFIG FILE #######################################
$_CONFIG_INI = parse_ini_file($_SERVER['DOCUMENT_ROOT']."/gestione/cfg/bsv.ini", true);
$arrcfg = $_CONFIG_INI['bsvillage'];
$sqlserver = $arrcfg['hostname'];
$sqluser = $arrcfg['username']; 
$sqlpass = $arrcfg['password']; 
$sqldb = $arrcfg['database'];
$ftp_host = $arrcfg['host'];
$ftp_username = $arrcfg['userftp'];
$ftp_pwd = $arrcfg['pwftp'];
$_CONFIG_INI = parse_ini_file($_SERVER['DOCUMENT_ROOT']."/gestione/cfg/arredo.ini", true);
$arrcfg = $_CONFIG_INI['arredo'];
$ftp_host_g = $arrcfg['host'];
$ftp_username_g = $arrcfg['userftp'];
$ftp_pwd_g = $arrcfg['pwftp'];
/////////////////////////////////////////////////////////////////////////////
$_CONFIG['table_sessioni'] = "session";
$_CONFIG['table_utenti'] = "utenti";
$_CONFIG['table_websession'] = "websession";
$_CONFIG['table_webuser'] = "webuser";
$_CONFIG['webexpire'] = 3600;

$_CONFIG['expire'] = 3600*5;
$_CONFIG['order_expire'] = 3600*48;

$_CONFIG['imballo'] = 500;
$_CONFIG['imballo_low'] = 3;
$_CONFIG['imballo_high'] = 6;
define('FOLDERNEW','ita');

//--------------
define('AUTH_LOGGED', 99);
define('AUTH_NOT_LOGGED', 100);

define('AUTH_USE_COOKIE', 101);
define('AUTH_USE_LINK', 103);
define('AUTH_INVALID_PARAMS', 104);
define('AUTH_LOGEDD_IN', 105);
define('AUTH_FAILED', 106);

//variabili classi Fileupload e image
$url = $_SERVER['DOCUMENT_ROOT'];
define('IMAGE_DIR', 'imgs_prodotti');
define('TMB_W', 40);
define('TMB_H', 40);
define('IMAGE_W', 80);
define('IMAGE_H', 80);
define('BIG_W', 200);
define('BIG_H', 200);
define('VIDEO_W', 470);
define('VIDEO_H', 400);
define('WIDTH',1000);
define('HEIGHT',1000);
############################# keywords #################################
define('FOLDER_ITA','piscine-giardino-fitness');
define('FOLDER_P','vendita-piscine');
define('FOLDER_G','articoli-giardino');
define('FOLDER_C','articoli-casa');
define('FOLDER_F','articoli-fitness');
define('FOLDER_ENG','swimming-pool-garden-fitness');
define('FOLDER_GER','scambiatori-di-calore');
define('FOLDER_FRA','scambiatori-di-calore');
$path_template = $url."/template/index.php";
$path_key_ita = $url."/".FOLDER_ITA."/";
$path_key_ita_ftp = "httpdocs/".FOLDER_ITA."/";
################## PISCINE ##############################################
$path_key_piscine = $url."/vendita-piscine/";
$path_key_piscine_ftp = "httpdocs/vendita-piscine/";
################## GIARDINO ##############################################
$path_key_giardino = $url."/articoli-giardino/";
$path_key_giardino_ftp = "httpdocs/articoli-giardino/";
################## CASA ##############################################
$path_key_casa = $url."/articoli-casa/";
$path_key_casa_ftp = "httpdocs/articoli-casa/";
################## FINTESS ##############################################
$path_key_fitness = $url."/articoli-fitness/";
$path_key_fitness_ftp = "httpdocs/articoli-fitness/";
#############################################################################
$path_key_eng = $url."/".FOLDER_ENG."/";
$path_key_eng_ftp = "httpdocs/".FOLDER_ENG."/";
####################################################################################
$id_user = $_COOKIE['id_user'];
$num_per_page = 20;
$num_page_show = 15;
$path_tmp = $_SERVER['DOCUMENT_ROOT']."/gestione/tmp/";
$path_tmp_tmb = $_SERVER['DOCUMENT_ROOT']."/gestione/tmp/";
$path_image = $_SERVER['DOCUMENT_ROOT']."/gestione/imgs_prodotti/";
$path_home = $_SERVER['DOCUMENT_ROOT']."/banner/home";
$path_allegato = $_SERVER['DOCUMENT_ROOT']."/gestione/files/";
$path_image_ftp = "gestione/imgs_prodotti/";
/////////// allegati newsletter ////////////////////
$path_allegato = $_SERVER['DOCUMENT_ROOT']."/gestione/files/";
$max_size = 2097152 * 2;
$max_size_image = 2097152;
$mesi = array(
"01"=>"Gennaio",
"02"=>"Febbraio",
"03"=>"Marzo",
"04"=>"Aprile",
"05"=>"Maggio",
"06"=>"Giugno",
"07"=>"Luglio",
"08"=>"Agosto",
"09"=>"Settembre",
"10"=>"Ottobre",
"11"=>"Novembre",
"12"=>"Dicembre"
);
//////////////////////////////////////////////////////////////
//DO NOT EDIT BELOW THIS LINE
//////////////////////////////////////////////////////////////
include('adodb.inc.php');
$conn = &ADONewConnection('mysql');
$conn->Connect($sqlserver, $sqluser, $sqlpass, $sqldb);
$conn->SetFetchMode(ADODB_FETCH_ASSOC);

$db = mysql_connect($sqlserver, $sqluser, $sqlpass);

mysql_select_db($sqldb,$db);
//cartelle Banner //////////////////////////////////////////////////////////
$path_image_Banner = $_SERVER['DOCUMENT_ROOT']."/gestione/imgs_Banner/";
$path_image_Banner_ftp = "/gestione/imgs_Banner/";
// cartella temporanea ///////////////////////////////////////////////////////
$path_tmp = $_SERVER['DOCUMENT_ROOT']."/gestione/tmp/";
####################### Banner ##################################################
include("banner.class.php");
$newBanner = new bannerConfig();
if(!is_null($newBanner->config))
  $_CONFIG = array_merge($_CONFIG,$newBanner->config);
#################################################################################
$_CONFIG['domain'] = "www.bsvillage.com";
$_CONFIG['bannerexpire'] = 3600 * 24 * 7;
$qry = "SELECT titledx,titledx_eng FROM home_new;";
$res = mysql_query($qry);
list($_CONFIG['titledx'],$_CONFIG['titledx_eng']) = mysql_fetch_row($res);
mysql_free_result($res);
################################## LINGUA ##########################################
$result1 = @mysql_query("SELECT nome,stato FROM utenti WHERE id='$id_user';");
list($username,$level) = mysql_fetch_row($result1);
if($level=="ce")
  setcookie('lang', 'eng', time()+ $_CONFIG['expire']);
$lang = $_COOKIE['lang'];
##################################################################################
?>